﻿using N02;

namespace 依赖倒置02
{
    internal class Program
    {
        static void Main(string[] args)
        {

            // 歌手唱中文歌

            // 歌手：对象一：唱歌
            // 歌曲：返回歌曲的歌词
            //N01.Singer singer = new N01.Singer();
            //singer.SingSong(new N01.ChineseSong());
            //singer.SingEnglish(new N01.EnglishSong());



            N02.Singer singer = new N02.Singer();
            ISongWords song = new ChineseSong();// 在客户端不能直接new服务对象，需要用依赖注入
            singer.SingSong(song);
           // 玩转C#之高级进阶 11.14 依赖注入的几种方式则 7：28
            song = new EnglishSong();
            singer.SingSong(song);
            Console.ReadLine();
        }
    }
}

    

 
